package Cafezam;

public class J12Fan {
	public static void main(String[] args)
	{
		Fan yFan=new Fan();
		yFan.radius=10;
		yFan.color="Yellow";
		yFan.speed=yFan.fast;
		yFan.on=true;
		System.out.println(yFan.toString());		
		Fan bFan=new Fan();
		bFan.radius=5;
		bFan.color="blue";
		bFan.speed=bFan.medium;
		bFan.on=false;
		System.out.println(bFan.toString());
	}

}
class Fan{
	
	final int slow=1;
	final int medium=2;
	final int fast=3;
	int speed=slow;
	boolean on = false;
	double radius=5.0;
	String color="blue";
	@Override  //부모클래스에서 정의된 메서드를
	                    //자손클래스에서 다시 정의함
	public String toString() {
		String result=""; 
		if(on==true)
		{
		result+=speed+"/"+color+"/"+radius+"/"+"작동중";
		}else
		{result+=color+"/"+radius+"/"+"꺼져있음";
		}
		return result;
	}
	
}